<?php

/**
 * Controller_external
 * 外聘教师列表
 */

class Controller_external extends MyApp {

	public function __construct()
	{
		parent::__construct();
        $this->model->excel    	= YOU::loadModel('excel');
		$this->model->record 	= YOU::loadModel('record');
		$this->model->user   	= YOU::loadModel('user');
		$this->model->log     	= YOU::loadModel('log');
		
	}

	/** 首页 **/
	public function actionIndex()
	{

	}

	/** 外聘教师列表 **/
	public function actionList ()
	{
		// 系统日记
		$a = $_GET['a'];
		$log_name = $this->user['user_name'];
		$this->model->log->add($a,$log_name);
		
		//按条件搜索
		$where = "  ";

		//获取到页面传过来的要搜索的条件
		$staff_position   = $this->get->staff_position;
		$staff_education  = $this->get->staff_education;
		$staff_name       = $this->get->staff_name;
		
		if (!empty($staff_position)) {
			$where .= " AND staff_position='{$staff_position}' ";
			$this->tpl->assign("staff_positon", $staff_position);
		}
		if (!empty($staff_education)) {
			$where .= " AND staff_education='{$staff_education}' ";
			$this->tpl->assign("staff_education", $staff_education);	
			//print_R('ssssssssss');
		}
		if (!empty($staff_name)) {
			$where .= " AND staff_name LIKE '{$staff_name}%' ";
			$this->tpl->assign("staff_name", $staff_name);			
		}
		
		// 分页
		YOU::loadLib('page', "", '0');
		$tmp = $this->db->fetchRow("SELECT COUNT(1) AS count FROM `tbl_staff` WHERE staff_external= '1' {$where} ");
		$count = $tmp['count'];
		$page_total = ceil($count/PAGE_LIMIT);

		// 当前页
		$p = intval($_GET['p']);
		if ($p == 0){
			$p  = 1;
		}
		if ($p > 1){
			$start = PAGE_LIMIT * ($p-1);
		}else{
			$start = 0;
		}

		// 非全部数据输出状态下才分页
		if(empty($this->get->output)){
			$limit = " LIMIT {$start}, ".PAGE_LIMIT;
		}else{
			$limit = "";
		}
		// staff_external=1 外聘管理
		$staff_lists = $this->db->fetchAll("SELECT * FROM `tbl_staff` WHERE staff_external= '1' {$where} ORDER BY staff_id DESC {$limit} ");

        foreach ($staff_lists as $key => $value){
			
			$staff_lists[$key]['staff_sex']       = $this->sex_ini[$value['staff_sex']];
			$staff_lists[$key]['staff_position']  = $this->position_ini[$value['staff_position']];
			$staff_lists[$key]['staff_education'] = $this->education_ini[$value['staff_education']];
			$staff_lists[$key]['staff_sign']      = $this->sign_ini[$value['staff_sign']];
			$staff_lists[$key]['staff_external']  = $this->staff_external_ini[$value['staff_external']];
			$staff_lists[$key]['staff_nature']  = $this->staff_nature_ini[$value['staff_nature']];									
		}

		$page = new Page(array('total' => $count, 'perpage' => PAGE_LIMIT));
		$page->next_page   = '下一页>';
		$page->pre_page    = '<上一页';
		$page->style_path  = "static/page_style";

		//按条件搜索结果  把职位 部门全部罗列到页面
		$department_lists = $this->db->fetchAll("SELECT `department_id`,`department_name` FROM `tbl_department`");
		$position_lists   = $this->db->fetchAll("SELECT `position_id`,`position_name` FROM `tbl_position`");

		//教师档案项目用反序列化取出
		$record_lists = $this->model->record->getInfo("teacher_list");

		$staffnew_lists = array();
		// 取所有员工
		foreach ($staff_lists as $key => $value){
			$staffnew_lists[$key]['staff_id'] = $value['staff_id'];
			// 反序列化的数组
			foreach ($record_lists as $k => $v){
				$staffnew_lists[$key][$v['name']] = $value[$v['name']];
				//性别显示
				if ($v['name'] == "staff_sex") {
					$staffnew_lists[$key][$v['name']] =  $this->sex_ini[$value[$v['name']]];
				}
				//职称显示
				if ($v['name'] == "staff_position") {
					$staffnew_lists[$key][$v['name']] =  $this->position_ini[$value[$v['name']]];
				}
				//在职标记显示
				if ($v['name'] == "staff_sign") {
					$staffnew_lists[$key][$v['name']] =  $this->sign_ini[$value[$v['name']]];
				}
				
			}
		};
		
		$page = new Page(array('total' => $count, 'perpage' => PAGE_LIMIT));
		$page->next_page   = '下一页>';
		$page->pre_page    = '<上一页';
		$page->style_path  = "static/page_style";
		$this->tpl->assign("page", $page->show(4, "yahoo"));
		
		$this->tpl->assign("staff_lists", $staff_lists);
		$this->tpl->assign("staffnew_lists", $staffnew_lists);
		$this->tpl->assign("department_lists", $department_lists);
		
		$this->tpl->assign("position_lists", $position_lists);
		$this->tpl->assign("record_lists", $record_lists);
		$this->tpl->display("external/external.list.tpl.php");
	}
    /*
    * 导出数据
    */

    public function actionoutData() 
    {
    	// 系统日记
		$a = $_GET['a'];
		$log_name = $this->user['user_name'];
		$this->model->log->add($a,$log_name);
		
        //按条件搜索
        $where = "  ";
        //var_dump($_GET);exit;

        //获取到页面传过来的要搜索的条件
        $staff_position   = (int)$this->get->staff_position;
        $staff_education  = (int)$this->get->staff_education;
        $staff_name       = $this->get->staff_name;

        if (!empty($staff_position)) {
            $where .= " AND staff_position='{$staff_position}' ";
            $this->tpl->assign("staff_positon", $staff_position);
        }
        if (!empty($staff_education)) {
            $where .= " AND staff_education='{$staff_education}' ";
            $this->tpl->assign("staff_education", $staff_education);
        }
        if (!empty($staff_name)) {
            $where .= " AND staff_name LIKE '%{$staff_name}%' ";
            $this->tpl->assign("staff_name", $staff_name);
        }
        $staff_lists = $this->db->fetchAll("SELECT * FROM `tbl_staff` WHERE staff_external= '1' {$where} ORDER BY staff_id ");

        $rule = $this->model->record->getInfo('teacher_list');
        $col = array();
        foreach($rule as $k => $v){
            $col[] = $v['title'];
        }

        $info = array();

        foreach ($staff_lists as $key => $value) {
            $i = 0;
            foreach ($rule as $k => $v){

                switch ($v['name']){
                    case  'staff_card':
                        $info[$i] = ' '.$value[$v['name']];
                        break;
                    case  'staff_graduate_time':
                        $info[$i] = ' '.$value[$v['name']];
                        break;
                    case  'staff_tel':
                        $info[$i] = ' '.$value[$v['name']];
                        break;
                    case  'staff_fix':
                        $info[$i] = ' '.$value[$v['name']];
                        break;
                    //                    case  'staff_party_date':
                    //                        $info[$i] = ' '.$value[$v['name']];
                    //                        break;
                    //                    case  'staff_ctime':
                    //                        $info[$i] = ' '.$value[$v['name']];
                    //                        break;
                    case  'end_time':
                        $info[$i] = ' '.$value[$v['name']];
                        break;
                    case  'start_time':
                        $info[$i] = ' '.$value[$v['name']];
                        break;
                    case  'staff_number':
                        $info[$i] = ' '.$value[$v['name']];
                        break;
                    case  'staff_sex':
                        $info[$i] = $this->sex_ini[$value[$v['name']]];
                        break;
                    case  'staff_education':
                        $info[$i] = $this->education_ini[$value[$v['name']]];
                        break;
                    case  'staff_position':
                        $info[$i] = $this->position_ini[$value[$v['name']]];//职称
                        break;
                    //                    case  'staff_position':
                    //                        $info[$i] = $this->position_type[$value[$v['name']]];//在职标记
                    case  'staff_sign':
                        $info[$i] = $this->sign_ini[$value[$v['name']]];
                        break;
                    case  'staff_party':
                        $info[$i] = $this->party_ini[$value[$v['name']]];
                        break;
                    case  'staff_assess':
                        $info[$i] = $this->assess_ini[$value[$v['name']]];
                        break;
                    case  'staff_externalx':
                        $info[$i] = $this->staff_externalx_ini[$value[$v['name']]];
                        break;
                    case  'staff_nature':
                        $info[$i] = $this->staff_nature_ini[$value[$v['name']]];
                        break;
                    //                    case  'staff_nature':
                    //                        $info[$i] = $this->staff_nature_ini[$value[$v['name']]];
                    //                        break;
                    default:
                        $info[$i] = $value[$v['name']];
                }
                $i++;

            }
            $data_lists[$key] = $info;

        }
        // var_dump($data_lists);exit;
        $this->model->excel->excel_ini['teachercount']['title'] = "外聘教师统计表";
        $this->model->excel->excel_ini['teachercount']['col'] = $col;
        $this->model->excel->outData("teachercount", $data_lists);
    }
    /** 批量导入教师信息 **/
    public function actionIn()
    {
    	// 系统日记
		$a = $_GET['a'];
		$log_name = $this->user['user_name'];
		$this->model->log->add($a,$log_name);
		
        //echo date('Y-m-d',strtotime('1994-01-03'));exit;
//var_dump($_FILES);exit;
        if($_POST){

            $check = $this->post->check;
            //var_dump($check);exit;
            $data = $this->model->excel->in('teachercount');
            //var_dump($data);exit;


            if(is_null($check)){

                $mes = '';
                foreach ($data as $k => $v){
                    $staff_card = $v['7'];
                    $row = $this->db->fetchRow("SELECT staff_card FROM `tbl_staff` WHERE staff_card='{$staff_card}' ");
                    //$this->db->query("DELETE  FROM `tbl_student` WHERE student_id='{$student_id}'");
                    if (!empty($row)) {
                        $mes .= "重复身份证号码为：{$staff_card} <br>";
                        $check = 2;

                        //$this->tpl->assign("staff_card", $staff_card);
//						$this->tpl->assign("check", $check);
//						$this->tpl->display("teacher/teacher.in.tpl.php");
//						exit;
                    }

                }
                if($check){
                    $this->tpl->assign("check", $check);
                $this->tpl->assign("mes", $mes);
                $this->tpl->display("external/external.in.tpl.php");
                exit;
                }
            }

            if($check=='del'){
                $data = $this->model->excel->in('teachercount',2);
                foreach ($data as $k => $v){
                    $staff_card = $v['7'];
                    //$row = $this->db->fetchRow("SELECT staff_card FROM `tbl_staff` WHERE staff_card='{$staff_card}' ");
                    $sid = $this->db->query("DELETE  FROM `tbl_staff` WHERE staff_card='{$staff_card}'");
                    //echo $sid ;exit;
                    $this->model->user->getDel($sid, "staff");
                }
            }elseif($check=='add'){
                $data = $this->model->excel->in('teachercount',2);
            }



            if(empty($data)){
                Helper_Client::alert("请上传文件");
            }

            foreach ($data as $key => $value){

                //echo $value[15];echo'    '. $value[16];exit;
                switch ($value[12]){
                    case '中共党员':
                        $value[12] = 1;
                        break;
                    case '共青团员':
                        $value[12] = 3;
                        break;
                    case '群众':
                        $value[12] = 0;
                        break;
                    case '中共预备党员':
                        $value[12] = 2;
                        break;
                    default:
                        $value[12] = 0;
                }


                switch ($value[40]){
                    case '专科以下':
                        $value[40] = 1;
                        break;
                    case '专科':
                        $value[40] = 2;
                        break;
                    case '本科':
                        $value[40] = 3;
                        break;
                    case '研究生':
                        $value[40] = 4;
                        break;
                    case '研究生以上':
                        $value[40] = 5;
                        break;
                    case '高中':
                        $value[40] = 6;
                        break;
                    case '中专':
                        $value[40] = 7;
                        break;
                    case '硕士研究生':
                        $value[40] = 8;
                        break;
                    case '博士研究生':
                        $value[40] = 9;
                        break;
                }
                switch ($value[39]){
                    case '未定级';
                        $value[39] = 1;
                        break;
                    case '一级教师';
                        $value[39] = 2;
                        break;
                    case '二级教师';
                        $value[39] = 3;
                        break;
                    case '三级教师';
                        $value[39] = 4;
                        break;
                    case '高级教师';
                        $value[39] = 5;
                        break;
                    case '正高级教师';
                        $value[39] = 6;
                        break;
                }
                // echo $value[37];exit;
                $info = array(
                    "staff_name" => $value[1],
                    "staff_usedname" => $value[2],
                    "staff_sex" => $value[3]=='男'?1:0,
                    "staff_number" => ''.$value[4],
                    "staff_area" => $value[5],
                    "staff_idtype" => $value[6],//证件类型
                    "staff_card" => ''.$value[7],
                    "staff_birth" => $value[8],//date('Y-m-d',strtotime($value[8])),
                    "staff_home" => $value[9],
                    "staff_city" => $value[10],
                    "staff_nation" => $value[11],
                    "staff_party" => $value[12],
                    "staff_marry" => $value[13],
                    "staff_health" => $value[14],
                    "start_time" => $value[15],//date('Y-m',strtotime($value[15])),
                    "end_time" => $value[16],//date('Y-m',strtotime($value[16])),
                    "staff_orignal" => $value[17],
                    "staff_classes" => $value[18],//leibie
                    "staff_nature" => $value[19],//zaibian
                    "staff_style" => $value[20],
                    "staff_signed" => $value[21],
                    "staff_normal" => $value[22],
                    "staff_skill" => $value[23],
                    "staff_certificate" => $value[24],
                    "staff_info" => $value[25],
                    "staff_free" => $value[26],
                    "staff_basic" => $value[27],
                    "staff_basic_start" => $value[28],
                    "staff_basic_end" => $value[29],
                    "staff_super" => $value[30],
                    "staff_bone" => $value[31],
                    "staff_mental" => $value[32],
                    "staff_zhuang" => $value[33],//zhuangtai
                    "staff_ctime" => date('Y-m-d',strtotime($value[34])),//diaodong
                    "staff_party_date" => $value[35],//date('Y-m-d',strtotime($value[35]))
                    "staff_addr" => $value[36],
                    "staff_fix" => ' '.''.$value[37],
                    "staff_tel" => ''.$value[38],
                    "staff_position" => $value[39],//zhicheng
                    "staff_education" => $value[40],
                    "staff_school" => $value[41],
                    "staff_graduate_time" => date('Y-m-d',strtotime($value[42])),
                    "staff_remark" => $value[43],
                    "staff_externalx" => $value[44]=='教师'?0:1,
                    "staff_external" => 1,
                    "staff_sign" => 6,
                    //"17" "staff_file" => $value[],
                );
                //var_dump($info);exit;
//				$staff_card = $value['7'];
//				$row = $this->db->fetchRow("SELECT staff_card FROM `tbl_staff` WHERE staff_card='{$staff_card}' ");
//				if (!empty($row)) {
//					$this->db->do_update("tbl_staff", $info, "staff_card='{$staff_card}'" );
//				}else{
                $this->model->user->add("staff", $info);
                //}

            }
            //echo 123;exit;
            // 跳转
            Helper_Client::location("添加成功", "index.php?a=external.list");


        }

        $this->tpl->display("external/external.in.tpl.php");
    }
//    public function actionOutData()
//    {
//
//
//        $external_lists = $this->db->fetchAll("SELECT * FROM `tbl_staff` WHERE staff_external= '1' ORDER BY staff_id DESC ");
//
//        foreach ($external_lists as $key => $value) {
//
//
//            $info = array(
//                //"姓名", "性别", "出生日期", "学历", "职称","参加工作时间","到校工作时间",
//                //"在职状态"
//
//                "0" => $value['staff_name'],
//                "1" => $this->sex_ini[$value['staff_sex']],
//                "2" => $value['staff_birth'],
//                "3" => $this->education_ini[$value['staff_education']],
//                "4" => $this->position_ini[$value['staff_position']],
//                "5" => $value['start_time'],
//                "6" => $value['end_time'],
//                "7" => $this->sign_ini[$value['staff_sign']],
//                "8" => $this->staff_nature_ini[$value['staff_nature']],
//
//            );
//            $data_lists[$key] = $info;
//
//        }
//        //var_dump($data_lists);exit;
//        // 模板标题
//
//        $this->model->excel->excel_ini['external']['title'] = "外聘教师表";
//        $this->model->excel->outData("external", $data_lists);
//
//        //$this->tpl->display();
//    }
//    public function actionIn(){
//        if($_POST){
//
//            $check = $this->post->check;
//            //var_dump($check);exit;
//            $data = $this->model->excel->in('external');
//            //var_dump($data);exit;
//
//            if($check!=='on'){
//                foreach ($data as $k => $v){
//                    $staff_card = $v['7'];
//                    $row = $this->db->fetchRow("SELECT staff_card FROM `tbl_staff` WHERE staff_card='{$staff_card}' ");
//                    if (!empty($row)) {
//                        $mes = "教师信息已存在，身份证号码为： ";
//                        $check = 2;
//                        $this->tpl->assign("mes", $mes);
//                        $this->tpl->assign("staff_card", $staff_card);
//                        $this->tpl->assign("check", $check);
//                        $this->tpl->display("external/external.in.tpl.php");
//                        exit;
//                    }
//
//                }
//            }
//
//
//
//            if(empty($data)){
//                Helper_Client::alert("请上传文件");
//            }
//            foreach ($data as $key => $value){
//                $info = array(
//                    "staff_name" => $value[1],
//                    "staff_usedname" => $value[2],
//                    "staff_sex" => $value[3],
//                    "staff_number" => $value[4],
//                    "staff_area" => $value[5],
//                    "staff_idtype" => $value[6],//证件类型
//                    "staff_card" => $value[7],
//                    "staff_birth" => $value[8],
//                    "staff_home" => $value[9],
//                    "staff_city" => $value[10],
//                    "staff_nation" => $value[11],
//                    "staff_party" => $value[12],
//                    "staff_marry" => $value[13],
//                    "staff_health" => $value[14],
//                    "start_time" => $value[15],
//                    "end_time" => $value[16],
//                    "staff_orignal" => $value[17],
//                    "staff_external" => $value[18],//leibie
//                    "staff_nature" => $value[19],//zaibian
//                    "staff_style" => $value[20],
//                    "staff_signed" => $value[21],
//                    "staff_normal" => $value[22],
//                    "staff_skill" => $value[23],
//                    "staff_certificate" => $value[24],
//                    "staff_info" => $value[25],
//                    "staff_free" => $value[26],
//                    "staff_basic" => $value[27],
//                    "staff_basic_start" => $value[28],
//                    "staff_basic_end" => $value[29],
//                    "staff_super" => $value[30],
//                    "staff_bone" => $value[31],
//                    "staff_mental" => $value[32],
//                    "staff_sign" => $value[33],//zhuangtai
//                    "staff_ctime" => $value[34],//diaodong
//                    "staff_party_date" => $value[35],
//                    "staff_addr" => $value[36],
//                    "staff_fix" => $value[37],
//                    "staff_tel" => $value[38],
//                    "staff_position" => $value[39],//zhicheng
//                    "staff_educate" => $value[40],
//                    "staff_school" => $value[41],
//                    "staff_graduate_time" => $value[42],
//                    "staff_remark" => $value[43],
//                    "staff_external" => 1,
//                    //"17" "staff_file" => $value[],
//                );
//                $staff_card = $value['7'];
//                $row = $this->db->fetchRow("SELECT staff_card FROM `tbl_staff` WHERE staff_card='{$staff_card}' ");
//                if (!empty($row)) {
//                    $this->db->do_update("tbl_staff", $info, "staff_card='{$staff_card}'" );
//                }else{
//                    $this->model->user->add("staff", $info);
//                }
//
//            }
//            //echo 123;exit;
//            // 跳转
//            Helper_Client::location("添加成功", "index.php?a=external.list");
//
//
//        }
//
//        $this->tpl->display("external/external.in.tpl.php");
//    }

	/** 外聘教师添加 **/
	public function actionAdd()
	{	
		
		// 系统日记
		$a = $_GET['a'];
		$log_name = $this->user['user_name'];
		$this->model->log->add($a,$log_name);
		
		// 职称
		$position	=	$this->position_ini;
		// 学历
		$education  =   $this->education_ini;
		// 职工类型
		$nature     =   $this->staff_nature_ini;
		// 党员显示
		$party      =	$this->party_ini;
		
		if ($_POST){
			
			$staff_name      = $this->post->staff_name;
			$staff_number    = $this->post->staff_number;
			$staff_sex       = $this->post->staff_sex;
			$staff_position  = $this->post->staff_position;
			$staff_education = $this->post->staff_education;
			$staff_birth     = $this->post->staff_birth;
			$staff_card      = $this->post->staff_card;
			$staff_entry     = $this->post->staff_entry;
			$staff_img       = $this->post->staff_img;
			$staff_file      = $this->post->staff_file;
			$start_time      = $this->post->start_time;
			$end_time        = $this->post->end_time;
			$staff_tel       = $this->post->staff_tel;
			$staff_nature    = $this->post->staff_nature;
			

			//查询数据库staff表中的身份证号码是否唯一
			$row = $this->db->fetchRow("SELECT staff_id FROM `tbl_staff` WHERE staff_card='{$staff_card}' ");
			if (empty($staff_name)) {
				Helper_Client::alert("姓名不能为空");
			}
			if (!empty($row)) {
				Helper_Client::alert("该教师信息已存在");
			}else{
				// 写入数据库
				$info = array(
				"staff_name"       => $staff_name,
				"staff_number"     => $staff_number,
				"staff_sex"        => $staff_sex,
				"staff_position"   => $staff_position,
				"staff_education"  => $staff_education,
				"staff_birth"      => $staff_birth,
				"staff_card"       => $staff_card,
				"staff_entry"      => $staff_entry,
				"staff_img"        => $staff_img,
				"staff_file"       => $staff_file,
				"start_time"       => $start_time,
				"end_time"         => $end_time,
				"staff_tel"        => $staff_tel,
				"staff_nature"     => $staff_nature,
				"staff_external"   => 1,
				);
				$this->model->user->add("staff", $info);
			}
			// 跳转
			Helper_Client::location("添加成功", "index.php?a=external.list");
		}
		$this->tpl->assign("position", $position);
		$this->tpl->assign("education", $education);
		$this->tpl->assign("nature", $nature);
		$this->tpl->assign("party", $party);
		
		$this->tpl->display("external/external.add.tpl.php");
	}

	/** 外聘教师修改 **/
	public function actionUpdate()
	{	
		// 系统日记
		$a = $_GET['a'];
		$log_name = $this->user['user_name'];
		$this->model->log->add($a,$log_name);
		
		$staff_id   = (int)$this->get->staff_id;
		$staff_data = $this->db->fetchRow("SELECT * FROM `tbl_staff` WHERE staff_id='{$staff_id}'");
		if (empty($staff_data)){
			Helper_Client::alert("人员不存在");
		}
		// 职称
		$position	=	$this->position_ini;
		// 学历
		$education  =   $this->education_ini;
		// 职工类型
		$nature     =   $this->staff_nature_ini;
		// 党员显示
		$party      =	$this->party_ini;
		
		if ($_POST){

			$staff_name      = $this->post->staff_name;
			$staff_number    = $this->post->staff_number;
			$staff_sex       = $this->post->staff_sex;
			$staff_position  = $this->post->staff_position;
			$staff_education = $this->post->staff_education;
			$staff_birth     = $this->post->staff_birth;
			$staff_card      = $this->post->staff_card;
			$staff_entry     = $this->post->staff_entry;
			$staff_img       = $this->post->staff_img;
			$staff_file      = $this->post->staff_file;
			$start_time      = $this->post->start_time;
			$end_time        = $this->post->end_time;
			$staff_tel       = $this->post->staff_tel;
			$staff_nature    = $this->post->staff_nature;

			// 写入数据库
			$info = array(
			
			"staff_name"       => $staff_name,
			"staff_number"     => $staff_number,
			"staff_sex"        => $staff_sex,
			"staff_position"   => $staff_position,
			"staff_education"  => $staff_education,
			"staff_birth"      => $staff_birth,
			"staff_card"       => $staff_card,
			"staff_entry"      => $staff_entry,
			"staff_img"        => $staff_img,
			"staff_file"       => $staff_file,
			"start_time"       => $start_time,
			"end_time"         => $end_time,
			"staff_tel"        => $staff_tel,
			"staff_nature"     => $staff_nature,
			"status"           => 1,
			"update_time"      => date("Y-m-d H:i:s"),

			);
			$this->db->do_update("tbl_staff", $info, "staff_id='{$staff_id}'");

			// 跳转
			Helper_Client::location("修改成功", "index.php?a=external.list");
		}
	
		$this->tpl->assign("position", $position);
		$this->tpl->assign("education", $education);
		$this->tpl->assign("nature", $nature);
		$this->tpl->assign("party", $party);
		
		$this->tpl->assign("staff_data", $staff_data);
		$this->tpl->display("external/external.update.tpl.php");
	}

	/** 外聘教师删除 **/
	public function actionDel ()
	{
		$staff_id = (int)$this->get->staff_id;
		$this->db->query("DELETE  FROM `tbl_staff` WHERE staff_id='{$staff_id}'");
		Helper_Client::location("删除成功", "index.php?a=external.list");
	}		
	/** ------------------------------- 外聘教师任命 ------------------------------------- **/



}

?>